<div class="pull-right">
      <!-- Quay về trang trước -->
      <a href="<?=site_url('product/edit/'.$product_id) ?>" class="btn btn-primary" role="button"><span class="glyphicon glyphicon-arrow-left"></span> Quay lại trang trước</a>
</div>
<form class="form-horizontal" method="post" action="<?=site_url('product/uploadImage/'.$product_id) ?>" autocomplete="on" enctype="multipart/form-data">
    <!-- CSRF Token -->
    <input type="hidden" name="_token" value="yDfAhrWn4oCenzIaABT5NEougJtnnGlQdRwJgXpM" />
    <input type="hidden" name="product_id" value="402" />

    <div class="form-group ">
        <label class="col-sm-2 control-label" for="image">Upload New Image<br /><code>(620 x 390) px</code><br /><code>Dung lượng <= 10MB</code></label>
        <div class="col-sm-5">
            <!-- <input class="form-control" type="text" name="image" id="image" value="" /> -->
            <div class="fileinput fileinput-new" data-provides="fileinput">
                <div class="fileinput-new thumbnail" style="width: 620px; height: 390px;">
                    <img src="http://placehold.it/620x390" alt="" />
                </div>                
                <div>
                    <span class="btn btn-default btn-file">
                        <input type="file" id="exampleInputFile" name="userfile">
                    </span>                    
                </div>
            </div>
		</div>
    </div>

    <!-- Form actions -->
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-5">
             <button type="submit" class="btn btn-success">Upload</button>
        </div>
    </div>
</form>


<div class="row">
<?php
	if(!empty($product_images)):
		foreach ($product_images as $product_image):			
?>
    <div class="col-sm-6 col-md-3">
      <div class="thumbnail">
        <img src="<?=base_url('uploads/image/products/'.$product_image->image) ?>" alt="" />
      	<div class="caption">
           <p><a href="<?=site_url('product/deleteImage/'.$product_image->id) ?>" class="btn btn-danger" role="button">Delete</a></p>
        </div>
      </div>
   	</div>
<?php
		endforeach;
	endif;
?>
</div>
